<?php
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('home', 'payment_management');
$this->breadcrumbs = array(
    Yii::t('home', 'payment_management') => array(Yii::t('app', 'index')),
    Yii::t('paymentmanagement', 'view') . ' (' . $payment->order_id . ')',
);

if (Yii::app()->user->isGuest || Yii::app()->user->id != SpecialUser::ADMIN_ID) {
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'mydialog',
        // additional javascript options for the dialog plugin
        'options' => array(
            'title' => Yii::t('home', 'message'),
            'autoOpen' => true,
            'modal' => true,
            'beforeClose' => 'js:function(){window.location = "' . $baseUrl . '/index.php?r=index";}',
            'buttons' => array(
                Yii::t('home', 'close') => 'js:function(){window.location = "' . $baseUrl . '/index.php?r=login";}'
            ),
        ),
    ));

    echo Yii::t('home', 'require_login');

    $this->endWidget('zii.widgets.jui.CJuiDialog');
    return;
}
?>
<div class="wrapper row3">
    <main class="container clear">
        <h1><?= Yii::t('foretell', 'view') ?></h1>

        <table style="width: 100%;">
            <tr>
                <th style="min-width: 150px; width: 150px;"></th>
                <th></th>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'payment_id') ?></td>
                <td><?= $payment->payment_id ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'order_id') ?></td>
                <td style="text-align: left;"><?php echo CHtml::link($payment->order_id, array('paymentmanagement/vieworder&id=' . $payment->order_id)); ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'bank') ?></td>
                <td><?= $payment->bank ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'bank_branch') ?></td>
                <td><?= $payment->bank_branch ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'payment_date') ?></td>
                <td><?= ConvertFormatUtil::getThaiDate($payment->payment_date) ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'time_payment') ?></td>
                <td><?= $payment->time ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'full_name') ?></td>
                <td><?= $payment->full_name ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'mobilephone') ?></td>
                <td><?= $payment->mobilephone ?></td>
            </tr>
            <tr>
                <td style="text-align: right;"><?= Yii::t('payment_model', 'remark') ?></td>
                <td><?= $payment->remark ?></td>
            </tr>
            <tr>
                <td style="text-align: right;">&nbsp;</td>
                <td><?php echo CHtml::button(Yii::t('foretell', 'back'), array('onclick' => 'js:window.location = "' . Yii::app()->getBaseUrl(true) . '/index.php?r=paymentmanagement"')); ?></td>
            </tr>


        </table>
    </main>
</div>